package xyz.xmh.pattern.behavioral.mementopattern;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * 备忘录管理类
 */
public class CareTaker {

    private final List<Memento> mementoList = new ArrayList<>();

    public void addMemento(Memento memento) {
        mementoList.add(memento);
    }

    public Memento getMemento(int index) {
        return mementoList.get(index);
    }
}
